
% function jumpR = jumpRate(x, vs, vi,startR)
% if x <= vs(startR,2)
%     jumpR = vi(startR,2);
% else if x > vs(startR,8)
%         jumpR = startR;
%     else for i = 2:7
%             if (x > vs(startR,i)) && (x<=vs(startR,i+1))
%                 jumpR = vi(startR,i+1);            
%             end
%         end
%     end
% end

function jumpR = jumpRate(x, vs, vi,startR)
if x <= vs(startR,1)
    jumpR = vi(startR,1);
    else for i = 2:size(vs,2)
            if (x > vs(startR,i-1)) && (x<=vs(startR,i))
                jumpR = vi(startR,i);            
            end
        end
 end